package cn.dapeng.rocket.message;

import java.util.ServiceLoader;

/**
 * @BelongProject message-queue
 * @BelongPackage cn.dapeng.rocket.message
 * @Description TODO
 * @ClassName MessageOperateServiceLoad
 * @Author xupenghong
 * @Date 2024/6/27 16:12
 * @Version 1.0.0
 */
public class MessageOperateServiceLoad {

    public MessageOperate messageOperate() {
        ServiceLoader<MessageOperate> serviceLoader = ServiceLoader.load(MessageOperate.class);
        for (MessageOperate messageOperate : serviceLoader) {
            return messageOperate;
        }
        throw new RuntimeException("没有找到对应的MQ实现类");
    }

}
